package com.liangzhong.proxy
{
	import com.socket.clientsocket.IClientSocket;
	import com.socket.clientsocket.IClientSocketHandler;
	
	import flash.events.Event;
	import flash.utils.ByteArray;
	
	import org.puremvc.as3.patterns.proxy.Proxy;
	
	/**
	 *服务信息基类 
	 * @author lxh
	 * 
	 */	
	public class BaseProxy extends Proxy implements IClientSocketHandler
	{
		private var _clientSocket :IClientSocket;
		
		public function BaseProxy(proxyName:String=null, data:Object=null)
		{
			super(proxyName, data);
		}
		/**
		 * 
		 * @param value
		 * 
		 */		
		public function set clientSocket(value:IClientSocket):void
		{
			_clientSocket = value;
		}
		/**
		 * 
		 * @return 
		 * 
		 */		
		public function get clientSocket():IClientSocket
		{
			return _clientSocket;
		}
		/**
		 * 连接上
		 * @param errorCode
		 * @param errorDesc
		 * @param clientSocket
		 * @return 
		 * 
		 */
		public function onSocketConnect(errorCode:int, errorDesc:String, clientSocket:IClientSocket):Boolean
		{
			return false;
		}
		
		public function onSocketRead(mainCmdID:uint, subCmdID:uint, buffer:ByteArray, dataSize:int, clientSocket:IClientSocket):Boolean
		{
			return false;
		}
		
		public function onSocketClose(clientSocket:IClientSocket, closeByServer:Boolean):Boolean
		{
			return false;
		}
		
		public function onSocketError(clientSocket:IClientSocket, e:Event):Boolean
		{
			return false;
		}
	}
}